﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CareerPathProject.Models;

namespace CareerPathProject.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        private WorksManagermentEntities wme = new WorksManagermentEntities();

        public ActionResult Index()
        {
            ViewData["can"] = wme.Candidates.ToList();
            return View("homePage");
        }
        public ActionResult detail(string id)
        {
            Candidate canDetail = wme.Candidates.Single(t => t.CandidateName.Equals(id));
            ViewData["canDetail"] = canDetail;
            return View("detail");
        }
    }
}
